<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>动态时钟</title>
	</head>

	<body>
		<div>
			北京时间：<span id="d1"></span>
		</div>
		<script>
			<!--
			function datetime() {
				var dated = new Date();
				var y = dated.getFullYear();
				var m = dated.getMonth() + 1;
				var d = dated.getDay();
				var h = dated.getHours();
				var min = dated.getMinutes();
				var s = dated.getSeconds();
				var div1 = document.getElementById("d1");
				div1.innerHTML = y + "年" + m + "月" + d + "日" + h + "时" + min + "分" + s + "秒";
			}
			window.setInterval("datetime()", 1000);
			-->
		</script>
	</body>
</html>
